package com.sr.security;

import com.sr.pojo.SysUser;
import com.sr.vo.resp.PermissionRespNodeVo;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.userdetails.UserDetails;

import java.util.Collection;
import java.util.List;

/**
 * @author xiaochi
 * @date 2022/5/2 17:31
 * @desc UserDetail
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
@EqualsAndHashCode(callSuper = true)
public class UserDetailVo extends SysUser implements UserDetails {

    private static final long serialVersionUID = -3217827025718779787L;

    private Collection<? extends GrantedAuthority> authorities;
    private boolean accountNonExpired;
    private boolean accountNonLocked;
    private boolean credentialsNonExpired;
    private boolean enabled;

    private String authorization;

    private List<PermissionRespNodeVo> menus;
    private List<String> permissions;
}
